﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Bootstrap5;

/// <summary>
/// Specified that a data field is <c>true</c>.
/// </summary>
public class CheckedAttribute:ValidationAttribute
{
	public override bool IsValid(object value)
	{
		if(value is not bool boolValue)
		{
			throw new NotSupportedException("This validation attribute is only support the type 'bool'");
		}
		return boolValue;
	}
}
